import os
import sys
import requests
import shutil


class Informator:
    def __init__(self):
        self.ip = requests.get("https://ident.me").text
        self.info()
    def info(self):
        response = requests.get(f'http://ipinfo.io/{self.ip}/json')
        self.user_country = response.json()['country']
        self.user_timezone = response.json()['timezone']
        return [self.ip,self.user_country]

    def getRegion(self):
        return self.user_country

    def getTimezone(self):
        return self.user_timezone

    def getFreeDiskSpace(self):
        total, used, free = shutil.disk_usage(__file__)
        return free